package com.xdtech.parking.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import javax.persistence.Column;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.parking.model.ParkUser;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2015-06-21 14:11:49
 * @since 1.0
 * @see
 */
public class ParkUserItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="用户名",width=100)
	private String name;
	@GridColumn(title="电话",width=100)
	private String telephone;
//	@GridColumn(title="密码",width=100)
//	private String password;
	@GridColumn(title="性别",width=100,dictionaryCode="SEX")
	private String sex;
	@GridColumn(title="用户类型",width=100,dictionaryCode="PARK_USER_TYPE")
	private String type;
	@GridColumn(title="状态",width=100,dictionaryCode="USER_STATUS")
	private String status;
	@GridColumn(title="是否VIP",width=100,dictionaryCode="YON")
	private String vip;
	@GridColumn(title="专属泊车号",width=100)
	private String parkNo;

	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setName(String name) {
		this.name = name;
		addQuerys("name", name);
	}
	public String getName() {
		return name;
	}
	
	public void setTelephone(String telephone) {
		this.telephone = telephone;
		addQuerys("telephone", telephone);
	}
	public String getTelephone() {
		return telephone;
	}
	
//	public void setPassword(String password) {
//		this.password = password;
//		addQuerys("password", password);
//	}
//	public String getPassword() {
//		return password;
//	}
	
	public void setSex(String sex) {
		this.sex = sex;
		addQuerys("sex", sex);
	}
	public String getSex() {
		return sex;
	}
	
	public void setType(String type) {
		this.type = type;
		addQuerys("type", type);
	}
	public String getType() {
		return type;
	}
	
	public void setStatus(String status) {
		this.status = status;
		addQuerys("status", status);
	}
	public String getStatus() {
		return status;
	}
	
	public String getVip()
	{
		return vip;
	}
	public void setVip(String vip)
	{
		this.vip = vip;
	}
	public String getParkNo()
	{
		return parkNo;
	}
	public void setParkNo(String parkNo)
	{
		this.parkNo = parkNo;
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static ParkUserItem createItem(ParkUser parkUser) {
		ParkUserItem parkUserItem = new ParkUserItem();
		BeanUtils.copyProperties(parkUserItem, parkUser);
		//自定义属性设置填充
		return parkUserItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<ParkUserItem> createItems(List<ParkUser> parkUsers) {
		List<ParkUserItem> parkUserItems = new ArrayList<ParkUserItem>();
		for (ParkUser parkUser : parkUsers) {
			parkUserItems.add(createItem(parkUser));
		}
		return parkUserItems;
	}
}
